﻿using System;
using System.Data;
using WorkFlow.Engine.NSActivity;
using WorkFlow.Engine;
namespace WorkFlow.web
{
    /// <summary>
    /// 归档
    /// </summary>
    [AjaxPro.AjaxNamespace("nsarc")]
    public partial class Archive : System.Web.UI.Page
    {
        [AjaxPro.AjaxMethod]
        public void archive(string actStr)
        {
            int actID = -1;
            if (!int.TryParse(actStr.Trim(), out actID)) return;
            WfActivity act = WfActivityController.CreateActivityController().GetActivity(actID, Convert.ToInt32(Session["USERID"]));
            act.Complete();
        }

        [AjaxPro.AjaxMethod]
        public DataTable LoadActAndCases(string actStr)
        {
            return new PublicCode.GetSpecifyCase().GetCase(actStr, Convert.ToInt32(Session["USERID"]));
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["USERID"] == null)
            {
                Response.Redirect("login.aspx");
                return;
            }
            AjaxPro.Utility.RegisterTypeForAjax(this.GetType(), this.Page);
        }
    }
}